package com.foreknow.springboot_demo.service.Impl;

import com.foreknow.springboot_demo.mapper.DeliveryAddressMapper;
import com.foreknow.springboot_demo.po.DeliveryAddress;
import com.foreknow.springboot_demo.service.DeliveryAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeliveryAddressServiceImpl implements DeliveryAddressService {

    @Autowired
    private DeliveryAddressMapper deliveryAddressMapper;

    @Override
    public List<DeliveryAddress> listDeliveryAddressByUserId(String userId) {
        return deliveryAddressMapper.listDeliveryAddressByUserId(userId);
    }

    @Override
    public DeliveryAddress getDeliveryAddressById(int daId) {
        return deliveryAddressMapper.getDeliveryAddressById(daId);
    }

    @Override
    public Integer saveDeliveryAddress(String contactName, int contactSex, String contactTel, String address, String userId) {
        return deliveryAddressMapper.saveDeliveryAddress(contactName,contactSex,contactTel,address,userId);
    }

    @Override
    public Integer updateDeliveryAddress(int daId, String contactName, int contactSex, String contactTel, String address) {
        return deliveryAddressMapper.updateDeliveryAddress(daId,contactName,contactSex,contactTel,address);
    }

    @Override
    public Integer removeDeliveryAddress(int daId) {
        return deliveryAddressMapper.removeDeliveryAddress(daId);
    }
}
